package com.dc.designPattern._5_adapter._1_classAdapter;

public class Phone {

    /**
     * 充电方法
     * @param voltage5V             适配接口
     */
    public void charging(IVoltage5V voltage5V){
        if (voltage5V.output5V() == 5) {
            System.out.println("电压为5V,可以充电~");
        } else {
            System.out.println("电压不为5V,不能充电!!");
        }
    }
}
